export default {
    data(){
        return {
            operaTypelist:[
                {label:this.$ct('global.common.create', { defaultValue: '创建' }),value:0},
                {label:this.$ct('fbb.inbound.common_update', { defaultValue: '更新' }),value:1},
                {label:this.$ct('erp.distribution.confirm_submit', { defaultValue: '提交' }),value:2},
                {label:this.$ct('fbb.truck.addprice', { defaultValue: '添加询价' }),value:3},
                {label:this.$ct('fbb.truck.confirmprice', { defaultValue: '确认询价' }),value:4},
                {label:this.$ct('fbb.truck.confirmwaretime', { defaultValue: '确认发货到仓时间' }),value:5},
                {label:this.$ct('global.common.upload',{defaultValue:'上传'})+'bol',value:6},
                {label:this.$ct('fbb.headlogistics.tuotou',{defaultValue:'妥投'}),value:7},
                {label:this.$ct('global.common.upload',{defaultValue:'上传'})+'pod',value:8},
                {label:this.$ct('global.common.operate_cancel',{defaultValue:'取消'}),value:9},
                {label:this.$ct('fbb.inbound.copy_order', { defaultValue: '单据复制' }),value:10},
            ],
        }
    },
    created() {
    },
    computed: {
        getLogActions() {
            return {
                4: this.$ct('fbb.inbound.common_tracking_to_boss', { defaultValue: 'tracking回写Boss' }),
                10: this.$ct('fbb.inbound.common_push_attachment', { defaultValue: '推送附件' }),
                13: this.$ct('fbb.inbound.common_stock_rewrite', { defaultValue: '库存流水回写' }),
                90: this.$ct('fbb.inbound.common_lose_efficacy', { defaultValue: '失效' }),
                96: this.$ct('fbb.inbound.common_fba_data_import', { defaultValue: 'FBA箱数据导入' }),
                100: this.$ct('global.common.create', { defaultValue: '创建' }),
                150: this.$ct('fbb.inbound.add_remark', { defaultValue: '添加备注' }),
                200: this.$ct('fbb.inbound.common_update', { defaultValue: '更新' }),
                210: this.$ct('global.common.operation_submit', { defaultValue: '提交' }),
                220: this.$ct('fbb.inbound.common_shipping', { defaultValue: '发运' }),
                230: this.$ct('fbb.inbound.common_save_and_commit', { defaultValue: '保存并提交' }),
                240: this.$ct('fbb.inbound.common_widthdraw_reply', { defaultValue: '撤回申请' }),
                250: this.$ct('global.common.save', { defaultValue: '保存' }),
                260: this.$ct('global.common.edit', { defaultValue: '编辑' }),
                290: this.$ct('fbb.inbound.common_unloading', { defaultValue: '卸货' }),
                300: this.$ct('global.common.delete', { defaultValue: '删除' }),
                400: this.$ct('global.common.cancel', { defaultValue: '取消' }),
                500: this.$ct('fbb.inbound.pass_audit', { defaultValue: "审核通过" }),
                560: this.$ct('fbb.inbound.cancel_audit', { defaultValue: '撤销审核' }),
                600: this.$ct('fbb.inbound.common_audit_rejection', { defaultValue: '审核拒绝' }),
                610: this.$ct('fbb.inbound.common_boss_handle', { defaultValue: 'BOSS处理' }),
                620: this.$ct('fbb.inbound.common_file_export', { defaultValue: '文件导出' }),
                700: this.$ct('fbb.inbound.audit', { defaultValue: '审核' }),
                710: this.$ct('fbb.inbound.common_outbound', { defaultValue: '已出库' }),
                720: this.$ct('global.common.confirmed', { defaultValue: '已确认' }),
                800: this.$ct('global.common.finish', { defaultValue: '完成' }),
                830: this.$ct('fbb.inbound.rawcrates_standard', { defaultValue: '生成箱标' }),
                840: this.$ct('fbb.inbound.common_operate_change_warehouse', { defaultValue: '换仓操作' }),
                930: this.$ct('fbb.inbound.common_push_warehouse', { defaultValue: '推送仓库' }),
                1010: this.$ct('fbb.inbound.common_notice_boss', { defaultValue: '调拨入库执行单回传boss' }),
                1020: this.$ct('fbb.inbound.click_packing', { defaultValue: '一键装箱' }),
                1030: this.$ct('fbb.inbound.confirm_delivery', { defaultValue: '确认发货' }),
                1031: this.$ct('fbb.inbound.modify_shipping_information', { defaultValue: '修改发运信息' }),
                1040: this.$ct('fbb.inbound.common_purchase_notice', { defaultValue: '采购入库执行单回传' }),
                1046: this.$ct('fbb.inbound.common_confirm_reach_warehouse', { defaultValue: '确认到仓' }),
                1050: this.$ct('fbb.inbound.common_confirm_push_boss', { defaultValue: '发运确认推送boss' }),
                1060: this.$ct('fbb.inbound.common_audit_push_boss', { defaultValue: '审核通过推送boss' }),
                1070: this.$ct('fbb.inbound.common_refuse_push_boss', { defaultValue: '审核退回推送boss' }),
                1047: this.$ct('fbb.inbound.port_confirm', { defaultValue: '到港确认' }),
                1073:this.$ct('fbb.inbound.common_warehouse_rewrite', { defaultValue: '仓库回写' }),
                1090:this.$ct('fbb.headlogistics.shangchuanfapiao', { defaultValue: '上传发票' })
            }
        },
    },
    methods:{
        getNowDate(){
            var d = new Date();
            var year = d.getFullYear();
            var month = d.getMonth() + 1;
            var day = d.getDate();
            var dateStr = year + '-' + this.getFormatDate(month) + '-' + this.getFormatDate(day);
            return dateStr;
        },
        getFormatDate(value){
            var result;
            result = value < 10 ? ("0" + value) : value;
            return result;
        },
        getDifferScale(value){
            var format;
            //获取转化比（天数跟毫秒数的比例）
            if (value == 1) {
                format = parseFloat(24 * 60 * 60 * 1000);
            }
                //获取转化比（小时数跟毫秒数的比例）
            else if (value == 2) {
                format = parseFloat(60 * 60 * 1000);
            }
                //获取转化比（分钟数跟毫秒数的比例）
            else if (value == 3) {
                format = parseFloat(60 * 1000);
            }
                //获取转化比（秒数跟毫秒数的比例）
            else if (value == 4) {
                format = parseFloat(1000);
            }
            return format;

        },
        getDifferDate(firstDate, secondDate, differ){
            //1)将两个日期字符串转化为日期对象
            var startDate = new Date(firstDate);
            var endDate = new Date(secondDate);
            //2)计算两个日期相差的毫秒数
            var msecNum = endDate.getTime() - startDate.getTime();
            //3)计算两个日期相差的天数
            var dayNum = Math.floor(msecNum /this.getDifferScale(differ));
            return dayNum;
        },
        // 获取时间指定天数
        getDay(day) {
            var today = new Date();
            var targetday_milliseconds =
                today.getTime() + 1000 * 60 * 60 * 24 * day;
            today.setTime(targetday_milliseconds); //注意，这行是关键代码
            var tYear = today.getFullYear();
            var tMonth = today.getMonth();
            var tDate = today.getDate();
            tMonth = this.doHandleMonth(tMonth + 1);
            tDate = this.doHandleMonth(tDate);
            return tYear + "-" + tMonth + "-" + tDate ;
        },
        doHandleMonth(month) {
            var m = month;
            if (month.toString().length == 1) {
                m = "0" + month;
            }
            return m;
        },
    }
}
